import { Card, Tabs } from "antd";
import React from "react";
import PackageList from "./packageList";
import CombinationList from "./combinationList";
import { formatMessage } from 'umi-plugin-react/locale';

class PackageManage extends React.Component{
  constructor(props){
    super(props);
    this.state = {
      activeKey:"package"
    }
  }

  componentDidMount(){
    
  }

  render(){
    const { activeKey } = this.state;

    return (
      <Card bordered={false} style={{minHeight:"100%"}}>
        <Tabs activeKey={activeKey} onChange={activeKey => this.setState({activeKey})}>
          <Tabs.TabPane tab={formatMessage({ id: 'chargingManage.packageManage.index.package' })} key="package">
            {activeKey === 'package' ? <PackageList /> : ''}
          </Tabs.TabPane>
          <Tabs.TabPane tab={formatMessage({ id: 'chargingManage.packageManage.index.packageCombination' })} key="combination">
            {activeKey === 'combination' ? <CombinationList /> : ''}
          </Tabs.TabPane>
        </Tabs>
      </Card>
    )
  }
}

export default PackageManage